package cn.weiyang.util;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

/**
 * Created by Administrator on 2017/7/8.
 */
public class GsonUtil {
    public static String toJson(Object obj){
        return new Gson().toJson(obj);
    }
    public static String toJson(Object obj,String dateFormat){
        GsonBuilder builder=new GsonBuilder();
        Gson gson=builder.setDateFormat("yyyy-MM-dd").create();
        return gson.toJson(obj);

    }
}
